1 /* 2 * This file is part of gtkD. 3 * 4 * gtkD is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU Lesser General Public License 6 * as published by the Free Software Foundation; either version 3 7 * of the License, or (at your option) any later version, with 8 * some exceptions, please read the COPYING file. 9 * 10 * gtkD is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU Lesser General Public License for more details. 14 * 15 * You should have received a copy of the GNU Lesser General Public License 16 * along with gtkD; if not, write to the Free Software 17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA 18 */ 19 20 // generated automatically - do not change 21 // find conversion definition on APILookup.txt 22 // implement new conversion functionalities on the wrap.utils pakage 23 24 25 module rsvg.c.types; 26 27 public import cairo.c.types; 28 public import gdkpixbuf.c.types; 29 public import gio.c.types; 30 public import glib.c.types; 31 public import gobject.c.types; 32 33 34 /** 35 * An enumeration representing possible errors 36 */ 37 public enum RsvgError 38 { 39 /** 40 * the request failed 41 */ 42 FAILED = 0, 43 } 44 alias RsvgError Error; 45 46 /** 47 * Configuration flags for an [class@Rsvg.Handle]. Note that not all of [class@Rsvg.Handle]'s 48 * constructors let you specify flags. For this reason, [ctor@Rsvg.Handle.new_from_gfile_sync] 49 * and [ctor@Rsvg.Handle.new_from_stream_sync] are the preferred ways to create a handle. 50 * 51 * Since: 2.40.3 52 */ 53 public enum RsvgHandleFlags 54 { 55 /** 56 * No flags are set. 57 */ 58 FLAGS_NONE = 0, 59 /** 60 * Disable safety limits in the XML parser. Libxml2 has 61 * [several limits](https://gitlab.gnome.org/GNOME/libxml2/blob/master/include/libxml/parserInternals.h) 62 * designed to keep malicious XML content from consuming too much memory while parsing. 63 * For security reasons, this should only be used for trusted input! Since: 2.40.3 64 */ 65 FLAG_UNLIMITED = 1, 66 /** 67 * Use this if the Cairo surface to which you are 68 * rendering is a PDF, PostScript, SVG, or Win32 Printing surface. This will make librsvg 69 * and Cairo use the original, compressed data for images in the final output, instead of 70 * passing uncompressed images. For example, this will make the a resulting PDF file 71 * smaller and faster. Please see [the Cairo 72 * documentation](https://www.cairographics.org/manual/cairo-cairo-surface-t.html#cairo-surface-set-mime-data) 73 * for details. 74 */ 75 FLAG_KEEP_IMAGE_DATA = 2, 76 } 77 alias RsvgHandleFlags HandleFlags; 78 79 /** 80 * Units for the `RsvgLength` struct. These have the same meaning as [CSS length 81 * units](https://www.w3.org/TR/CSS21/syndata.html#length-units). 82 */ 83 public enum RsvgUnit 84 { 85 /** 86 * percentage values; where <literal>1.0</literal> means 100%. 87 */ 88 PERCENT = 0, 89 /** 90 * pixels 91 */ 92 PX = 1, 93 /** 94 * em, or the current font size 95 */ 96 EM = 2, 97 /** 98 * x-height of the current font 99 */ 100 EX = 3, 101 /** 102 * inches 103 */ 104 IN = 4, 105 /** 106 * centimeters 107 */ 108 CM = 5, 109 /** 110 * millimeters 111 */ 112 MM = 6, 113 /** 114 * points, or 1/72 inch 115 */ 116 PT = 7, 117 /** 118 * picas, or 1/6 inch (12 points) 119 */ 120 PC = 8, 121 } 122 alias RsvgUnit Unit; 123 124 /** 125 * Dimensions of an SVG image from [method@Rsvg.Handle.get_dimensions], or an 126 * individual element from [method@Rsvg.Handle.get_dimensions_sub]. Please see 127 * the deprecation documentation for those functions. 128 * 129 * Deprecated: Use [method@Rsvg.Handle.get_intrinsic_size_in_pixels] or 130 * [method@Rsvg.Handle.get_geometry_for_layer] instead. 131 */ 132 struct RsvgDimensionData 133 { 134 /** 135 * SVG's width, in pixels 136 */ 137 int width; 138 /** 139 * SVG's height, in pixels 140 */ 141 int height; 142 /** 143 * SVG's original width, unmodified by `RsvgSizeFunc` 144 */ 145 double em; 146 /** 147 * SVG's original height, unmodified by `RsvgSizeFunc` 148 */ 149 double ex; 150 } 151 152 struct RsvgHandle 153 { 154 GObject parent; 155 void*[16] AbiPadding; 156 } 157 158 /** 159 * Class structure for [class@Rsvg.Handle]. 160 */ 161 struct RsvgHandleClass 162 { 163 /** 164 * parent class 165 */ 166 GObjectClass parent; 167 void*[15] AbiPadding; 168 } 169 170 /** 171 * `RsvgLength` values are used in [method@Rsvg.Handle.get_intrinsic_dimensions], for 172 * example, to return the CSS length values of the `width` and 173 * `height` attributes of an `<svg>` element. 174 * 175 * This is equivalent to [CSS lengths](https://www.w3.org/TR/CSS21/syndata.html#length-units). 176 * 177 * It is up to the calling application to convert lengths in non-pixel units 178 * (i.e. those where the @unit field is not `RSVG_UNIT_PX`) into something 179 * meaningful to the application. For example, if your application knows the 180 * dots-per-inch (DPI) it is using, it can convert lengths with @unit in 181 * `RSVG_UNIT_IN` or other physical units. 182 */ 183 struct RsvgLength 184 { 185 /** 186 * numeric part of the length 187 */ 188 double length; 189 /** 190 * unit part of the length 191 */ 192 RsvgUnit unit; 193 } 194 195 /** 196 * Position of an SVG fragment from [method@Rsvg.Handle.get_position_sub]. Please 197 * the deprecation documentation for that function. 198 * 199 * Deprecated: Use [method@Rsvg.Handle.get_geometry_for_layer] instead. 200 */ 201 struct RsvgPositionData 202 { 203 /** 204 * position on the x axis 205 */ 206 int x; 207 /** 208 * position on the y axis 209 */ 210 int y; 211 } 212 213 /** 214 * A data structure for holding a rectangle. 215 * 216 * Since: 2.46 217 */ 218 struct RsvgRectangle 219 { 220 /** 221 * X coordinate of the left side of the rectangle 222 */ 223 double x; 224 /** 225 * Y coordinate of the the top side of the rectangle 226 */ 227 double y; 228 /** 229 * width of the rectangle 230 */ 231 double width; 232 /** 233 * height of the rectangle 234 */ 235 double height; 236 } 237 238 /** 239 * Function to let a user of the library specify the SVG's dimensions 240 * 241 * See the documentation for [method@Rsvg.Handle.set_size_callback] for an example, and 242 * for the reasons for deprecation. 243 * 244 * Deprecated: Use [method@Rsvg.Handle.render_document] instead, which lets you specify 245 * a viewport size in which to render the SVG document. 246 * 247 * Params: 248 * width = the width of the SVG 249 * height = the height of the SVG 250 * userData = user data 251 */ 252 public alias extern(C) void function(int* width, int* height, void* userData) RsvgSizeFunc; 253 254 /** 255 * This is a C macro that expands to a number with the major version 256 * of librsvg against which your program is compiled. 257 * 258 * For example, for librsvg-2.3.4, the major version is 2. 259 * 260 * C programs can use this as a compile-time check for the required 261 * version, but note that generally it is a better idea to do 262 * compile-time checks by calling [pkg-config](https://www.freedesktop.org/wiki/Software/pkg-config/) 263 * in your build scripts. 264 * 265 * Note: for a run-time check on the version of librsvg that your 266 * program is running with (e.g. the version which the linker used for 267 * your program), or for programs not written in C, use 268 * `rsvg_major_version` instead. 269 */ 270 enum MAJOR_VERSION = 2; 271 alias LIBRSVG_MAJOR_VERSION = MAJOR_VERSION; 272 273 /** 274 * This is a C macro that expands to a number with the micro version 275 * of librsvg against which your program is compiled. 276 * 277 * For example, for librsvg-2.3.4, the micro version is 4. 278 * 279 * C programs can use this as a compile-time check for the required 280 * version, but note that generally it is a better idea to do 281 * compile-time checks by calling [pkg-config](https://www.freedesktop.org/wiki/Software/pkg-config/) 282 * in your build scripts. 283 * 284 * Note: for a run-time check on the version of librsvg that your 285 * program is running with (e.g. the version which the linker used for 286 * your program), or for programs not written in C, use 287 * `rsvg_micro_version` instead. 288 */ 289 enum MICRO_VERSION = 3; 290 alias LIBRSVG_MICRO_VERSION = MICRO_VERSION; 291 292 /** 293 * This is a C macro that expands to a number with the minor version 294 * of librsvg against which your program is compiled. 295 * 296 * For example, for librsvg-2.3.4, the minor version is 3. 297 * 298 * C programs can use this as a compile-time check for the required 299 * version, but note that generally it is a better idea to do 300 * compile-time checks by calling [pkg-config](https://www.freedesktop.org/wiki/Software/pkg-config/) 301 * in your build scripts. 302 * 303 * Note: for a run-time check on the version of librsvg that your 304 * program is running with (e.g. the version which the linker used for 305 * your program), or for programs not written in C, use 306 * `rsvg_minor_version` instead. 307 */ 308 enum MINOR_VERSION = 54; 309 alias LIBRSVG_MINOR_VERSION = MINOR_VERSION; 310 311 /** 312 * This is a C macro that expands to a string with the version of 313 * librsvg against which your program is compiled. 314 * 315 * For example, for librsvg-2.3.4, this macro expands to 316 * `"2.3.4"`. 317 * 318 * C programs can use this as a compile-time check for the required 319 * version, but note that generally it is a better idea to do 320 * compile-time checks by calling [pkg-config](https://www.freedesktop.org/wiki/Software/pkg-config/) 321 * in your build scripts. 322 * 323 * Note: for a run-time check on the version of librsvg that your 324 * program is running with (e.g. the version which the linker used for 325 * your program), or for programs not written in C, use 326 * `rsvg_version` instead. 327 */ 328 enum VERSION = "2.54.3"; 329 alias LIBRSVG_VERSION = VERSION;